//check chinese
function chkKanji(objId){
    var isValueFlag = false;
    var returnValue = new Array();
    var value = "";
    if (arguments.length >= 2){
        isValueFlag = arguments[1];
    } else {}
    if(isValueFlag){
        value = objId;
    } else {
        value = toRTrim(jQuery("#" + objId).val());
    }
    var reg=/^[\u0391-\uFFE5]+$/;
    if(reg.test(value)){
        returnValue[0] = true;
        returnValue[1] = "";
    }else{
        returnValue[0] = false;
        returnValue[1] = "";
    }
    return returnValue;
}

//check URL
function chkURL(objId){
    var isValueFlag = false;
    var returnValue = new Array();
    var value = "";
    if (arguments.length >= 2){
        isValueFlag = arguments[1];
    } else {}
    if(isValueFlag){
        value = objId;
    } else {
        value = toRTrim(jQuery("#" + objId).val());
    }
    var reg=/^((http|https):\/\/)[\d\a-zA-Z\`\-\=\\\[\]\;\'\,\.\/\~\!\@\#\$\%\^\&\*\(\)\_\+\|\{\}\:\"\<\>\?]+$/;
    if(reg.test(value)){
        returnValue[0] = true;
        returnValue[1] = "";
    }else{
        returnValue[0] = false;
        returnValue[1] = "ERR-100027";
    }
    return returnValue;
}

//check Tel
function chkTel(objId){
    var isValueFlag = false;
    var returnValue = new Array();
    var value = "";
    if (arguments.length >= 2){
        isValueFlag = arguments[1];
    } else {}
    if(isValueFlag){
        value = objId;
    } else {
        value = toRTrim(jQuery("#" + objId).val());
    }
    var reg=/^[0-9]{10,11}$/;
    if(reg.test(value)){
        returnValue[0] = true;
        returnValue[1] = "";
    }else{
        returnValue[0] = false;
        returnValue[1] = "ERR-100055";
    }
    return returnValue;
}

//check HyphenTel
function chkHyphenTel(objId){
    var isValueFlag = false;
    var returnValue = new Array();
    var value = "";
    if (arguments.length >= 2){
        isValueFlag = arguments[1];
    } else {}
    if(isValueFlag){
        value = objId;
    } else {
        value = toRTrim(jQuery("#" + objId).val());
    }
    var reg=/^[0-9-]{12,13}$/;
    if(reg.test(value)){
        returnValue[0] = true;
        returnValue[1] = "";
    }else{
        returnValue[0] = false;
        returnValue[1] = "ERR-100055";
    }
    return returnValue;
}

//check post
function chkPost(objId){
    var isValueFlag = false;
    var returnValue = new Array();
    var value = "";
    if (arguments.length >= 2){
        isValueFlag = arguments[1];
    } else {}
    if(isValueFlag){
        value = objId;
    } else {
        value = toRTrim(jQuery("#" + objId).val());
    }
    var reg=/^[0-9]{3}[-][0-9]{4}$/;
    if(reg.test(value)){
        returnValue[0] = true;
        returnValue[1] = "";
    }else{
        returnValue[0] = false;
        returnValue[1] = "ERR-100056";
    }
    return returnValue;
}

//check IP
function chkIPAddress(objId){
    var isValueFlag = false;
    var returnValue = new Array();
    var value = "";
    if (arguments.length >= 2){
        isValueFlag = arguments[1];
    } else {}
    if(isValueFlag){
        value = objId;
    } else {
        value = toRTrim(jQuery("#" + objId).val());
    }
    var reg=/^[0-9]{1,3}[.][0-9]{1,3}[.][0-9]{1,3}[.][0-9]{1,3}$/;
    var result = reg.test(value);

    if(result==false){
        returnValue[0] = false;
        returnValue[1] = "ERR-100257";
    } else {
        var arrIp = value.split(".");
        if((parseInt(arrIp[0])>255 || parseInt(arrIp[0])==127)||parseInt(arrIp[1])>255||parseInt(arrIp[2])>255||parseInt(arrIp[3])>255){
            returnValue[0] = false;
            returnValue[1] = "ERR-100257";
        }else{
            returnValue[0] = true;
            returnValue[1] = "";
        }
    }
    return returnValue;
}

//check Fax
function chkFax(objId){
    var isValueFlag = false;
    var returnValue = new Array();
    var value = "";
    if (arguments.length >= 2){
        isValueFlag = arguments[1];
    } else {}
    if(isValueFlag){
        value = objId;
    } else {
        value = toRTrim(jQuery("#" + objId).val());
    }
    var reg=/^[0-9]{10,11}$/;
    if(reg.test(value)){
        returnValue[0] = true;
        returnValue[1] = "";
    }else{
        returnValue[0] = false;
        returnValue[1] = "ERR-100131";
    }
    return returnValue;
}

//check Mobile TEl
function chkMobileTel(objId){
    var isValueFlag = false;
    var returnValue = new Array();
    var value = "";
    if (arguments.length >= 2){
        isValueFlag = arguments[1];
    } else {}
    if(isValueFlag){
        value = objId;
    } else {
        value = toRTrim(jQuery("#" + objId).val());
    }
    var reg=/^[0-9]{10,11}$/;
    if(reg.test(value)){
        returnValue[0] = true;
        returnValue[1] = "";
    }else{
        returnValue[0] = false;
        returnValue[1] = "ERR-100055";
    }
    return returnValue;
}